//
//  AddCityViewController.m
//  CC_Weather
//
//  Created by rimi on 16/9/23.
//  Copyright © 2016年 cc. All rights reserved.
//

#import "AddCityViewController.h"

@interface AddCityViewController ()

- (void)initUserInterface;/**<初始化界面 */

@end

@implementation AddCityViewController


#pragma mark - life circle
- (void)viewDidLoad {
    [super viewDidLoad];
    [self initUserInterface];
}


#pragma mark - init

-(void)initUserInterface{
    self.view.backgroundColor = [UIColor colorWithRed:0.432 green:0.5245 blue:0.705 alpha:1.0];
    //backButton
    UIButton *backButton = [[UIButton alloc]initWithFrame:CGRectMake(20, 30, 25, 25)];
    [backButton setBackgroundImage:[UIImage imageNamed:@"back"] forState:UIControlStateNormal];
    [backButton addTarget:self action:@selector(buttonClick:) forControlEvents:UIControlEventTouchUpInside];
    backButton.tag = 100;
    [self.view addSubview:backButton];
}

- (void)buttonClick:(UIButton *)button{
    NSInteger index = button.tag - 100;
    switch (index) {
        case 0:
            [self dismissViewControllerAnimated:YES completion:nil];
            break;
            
        default:
            break;
    }
}
@end
